﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="FinLend002a.aspx.cs" Inherits="Admin_FinLend_FinLend002a" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phScript" runat="Server">
    <link href="../../Plugin/font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet" />
    <script type="text/javascript" src="/Scripts/Controls/DatePicker/WdatePicker.js""></script>
    <style type="text/css">
        .subTable
        {
            border: none !important;
        }

            .subTable td
            {
                border: none !important;
                padding-right: 8px;
            }
    </style>
    <script type="text/javascript">
        $(function () {
            $("i[data-hid]").each(function () {
                $(this).click(function () {
                    var did = $(this).attr("data-hid");

                    $("[data-id='" + did + "']").each(function () {
                        $(this).toggle();
                    });
                });
            });

            $("#chk_sel_all").change(function () {
                var isChecked = $(this).is(":checked");

                $(".sel_class>input[type='checkbox']").each(function () {
                    $(this).attr("checked", isChecked);
                });

            });

        });


        function addKey() {
            var checkList = $(".pagnationtable input:checked");
            if (checkList.length > 0) {
                if (confirm("您确定将所选凭证设为财务关键数据？")) {
                    var ids = "";
                    checkList.each(function () {
                        ids += $(this).attr("id").replace("chk_sel", "") + ",";
                    });
                    $("#<%=HiddenFieldIds.ClientID%>").val(ids);
                    $("#<%=btnSave.ClientID%>").click();
                }
            }
            else {
                alert("请选择凭证!");
            }
        }

        function deleteKey() {
            var checkList = $(".pagnationtable input:checked");
            if (checkList.length > 0) {
                if (confirm("您确定将所选凭证设为财务关键数据？")) {
                    var ids = "";
                    checkList.each(function () {
                        ids += $(this).attr("id").replace("chk_sel", "") + ",";
                    });
                    $("#<%=HiddenFieldIds.ClientID%>").val(ids);
                    $("#<%=btnDelete.ClientID%>").click();
                }
            }
            else {
                alert("请选择凭证!");
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div style="width: 100%; min-width: 700px">
            
        </div>
        <table width="100%" cellspacing="2" cellpadding="2" class="menu" align="left" style="margin-top:10px;">
            <td style="width:3px;">
                &nbsp;
            </td>
            <td class="td">
                <a class="key" onclick="addKey()" href="#">设为关键数据</a>
                <a class="keygray" onclick="deleteKey()" href="#">设为非关键数据</a>                
                <a class="back"  href="FinLend002.aspx";">返回</a>
            </td>
        </table>
        <yncWeb:PagnationGrid PageSize="100" ID="pageGrid" runat="server" OnOnPageIndexChange="PageChanged">
            <HeaderTemplate>
                <table width="2080px" cellspacing="0" cellpadding="0" class="pagnationtable" align="left" style="table-layout:fixed">
                    <thead>
                        <tr>
                            <th width="60px"><asp:CheckBox ID="chk_sel_all" ClientIDMode="Static" runat="server" Text="序号" />
                            </th>
                            <th width="40px">SAP?</th>
                            <th width="90px">关键数据
                            </th>
                            <th width="90px">凭证盒条码
                            </th>
                            <th width="90px">外仓条形码
                            </th>
                            <th width="110px">文档描述
                            </th>
                            <th width="110px">文档日期
                            </th>
                            <th width="150px"><a class="thTitle" href="#" onclick="return false;" title="Document Number in SAP">凭证索引号1(SAP)</a>
                            </th>
                            <th width="150px"><a class="thTitle" href="#" onclick="return false;" title="Reference in SAP">凭证索引号2(SAP)</a>
                            </th>
                            <th width="150px"><a class="thTitle" href="#" onclick="return false;" title="Reference Key in SAP">凭证索引号3(SAP)</a>
                            </th>
                            <th width="150px"><a class="thTitle" href="#" onclick="return false;" title="Document Header in SAP">凭证索引号4(SAP)</a>
                            </th>
                            <th width="100px"><a class="thTitle" href="#" onclick="return false;" title="Company Code in SAP">公司代码(SAP)</a>
                            </th>
                            <th width="100px">公司名称
                            </th>
                            <th width="100px">职能部门
                            </th>
                            <th width="100px">实物存储状态
                            </th>
                            <th width="100px">实物存储地点
                            </th>
                            <th width="100px">电子存储状态
                            </th>
                            <th width="100px">初次入库时间
                            </th>
                            <th width="100px">已保管期限
                            </th>
                            <th width="100px">应保管期限
                            </th>
                            <th width="100px">销毁时间
                            </th>
                            <th width="100px">备注
                            </th>
                            
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td class="sel_class">
                       <i class="fa fa fa-info-circle" style="cursor:pointer;" data-hid="d<%# Container.ItemIndex +1 %>" ></i> <%# Container.ItemIndex +1 %>
                        <input type="hidden" id="h<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>"  value="<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>"/>
                                <input type="checkbox" id="chk_sel<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>" />
                                <asp:Label ID="lbReceiptID" runat="server" Visible="false" Text = "<%# Eval(FinReceiptMetadata.ColumnNames.ReceiptID) %>"></asp:Label>
                    </td>
                    <td>
                        <%# GetYesOrNo(Eval(FinReceiptMetadata.ColumnNames.IsSAP))%>
                    </td>
                    <td>
                        <%#Eval(FinLendReceiptMetadata.ColumnNames.IsKey).ToString()=="True"?"是":"否"%>
                    </td>
                    <td>
                        <%#Eval(VReceiptExtInfoMetadata.ColumnNames.BoxNo)%>
                    </td>
                    <td>
                        <%#Eval(VReceiptExtInfoMetadata.ColumnNames.SupplierBoxNo)%>
                    </td>                    
                    <td>
                        <%#Eval("VoucherDescriptionName")%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.VoucherDate)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentsNo)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.Reference)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.ReferenceKey)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentHeaderText)%>
                    </td>
                    <td>
                        <%# Eval(BFCompanyDicMetadata.ColumnNames.CompanyCode)%>
                    </td>
                    <td>
                        <%# Eval(BFCompanyDicMetadata.ColumnNames.CompanyName)%></td>
                    <td>
                        <%#Eval(FinReceiptMetadata.ColumnNames.FunctionDept+"Str")%>
                    </td>
                    <td><%# Eval(FinReceiptMetadata.ColumnNames.StorageStatus+"Str")%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.StorageLocation+"Str")%>
                    </td> 
                    
                    <td><%# Eval(FinReceiptMetadata.ColumnNames.EStorageStatus)%>
                    </td>                  
                    <td><%#Eval(FinReceiptMetadata.ColumnNames.FirstStorageDate).FormatDate(ConstantValue.DateFormat)%></td>
                    <td>
                        <%#getYear(Eval(FinReceiptMetadata.ColumnNames.StoreStartDate))%>
                    </td>
                    <td>
                        <%#Eval(FinReceiptMetadata.ColumnNames.NeedStoreYear)%>
                    </td>
                    <td>
                        <%#Eval(FinReceiptMetadata.ColumnNames.DestoryDate)%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.Comments)%>
                    </td>
                   
                </tr>
                <tr class="odd"  style="display:none" data-id="d<%# Container.ItemIndex +1 %>" >
                    <td colspan="2"><b>录入人</b></td>
                    <td colspan="4">
                        <%#Eval(FinReceiptMetadata.ColumnNames.CreatedBy)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Reversed With in SAP">冲销凭证号(SAP)</a></td>
                    <td colspan="5">
                        <%# Eval(FinReceiptMetadata.ColumnNames.RevesedBy)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Document Type in SAP">凭证类型(SAP)</a></td>
                    <td colspan="8">
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentsType)%></td>
                </tr>
                <tr class="odd"  style="display:none" data-id="d<%# Container.ItemIndex +1 %>">
                    <td colspan="2"><b>录入时间</b></td>
                    <td colspan="4">
                        <%#Eval(FinReceiptMetadata.ColumnNames.CreatedDttm).FormatDate(ConstantValue.DateTimeFormat)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="User Name in SAP">用户名(SAP)</a></td>
                    <td colspan="5">
                        <%#Eval(FinReceiptMetadata.ColumnNames.UserName)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Reference Trasact in SAP">业务类型(SAP)</a></td>
                    <td colspan="9">
                        <%# Eval(FinReceiptMetadata.ColumnNames.ReferenceTransact)%></td>
                </tr>
                <tr class="odd"  style="display:none" data-id="d<%# Container.ItemIndex +1 %>">
                    <td colspan="2"><b>转移记录</b></td>
                    <td colspan="4">
                        <%#Eval(FinReceiptMetadata.ColumnNames.TransferRecord)%></td>
                    
                    <td><a class="thTitle" href="#" onclick="return false;" title="Document Date in SAP">凭证日期(SAP)</a></td>
                    <td colspan="5">
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentDate).FormatDate(ConstantValue.DateFormat)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="这条凭证信息来自于哪个SAP系统">凭证系统(SAP)</a></td>
                    <td colspan="9">
                        <%# Eval(FinReceiptMetadata.ColumnNames.DocumentSystem)%></td>
                </tr>
                <tr class="odd"  style="display:none" data-id="d<%# Container.ItemIndex +1 %>">
                    <td colspan="2"><b>转移日期</b></td>
                    <td colspan="4"><%#Eval(FinReceiptMetadata.ColumnNames.LastTransferDate).FormatDate(ConstantValue.DateFormat)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Posting Date in SAP">凭证入帐日期(SAP)</a></td>
                    <td colspan="5">
                        <%# Eval(FinReceiptMetadata.ColumnNames.PostingDate).FormatDate(ConstantValue.DateFormat)%></td>
                    <td><a class="thTitle" href="#" onclick="return false;" title="Logical System in SAP">关联系统(SAP)</a></td>
                    <td colspan="9">
                        <%# Eval(FinReceiptMetadata.ColumnNames.LogicalSystem)%></td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </yncWeb:PagnationGrid>
    </div>
    <asp:Button ID="btnSave" runat="server" Text="确认" OnClick="btnSave_Click" Style="display:none" />
    <asp:Button ID="btnDelete" runat="server" Text="删除" OnClick="btnDelete_Click" Style="display:none" />
    
    <asp:HiddenField ID="HiddenFieldIds" runat="server" />

    <script type="text/javascript">
        var index;
        function showNews(msg) {
            alert(msg);
            window.location.href = "FinLend002a.aspx?lendId=<%=lendId%>";
        }
    </script>  
</asp:Content>
